
package com.q.springboot.framework.util;

public class Holder<T> {
    public T target;

    public static <T> Holder<T> of(T t) {
        return new Holder(t);
    }

    public static <T> Holder<T> empty() {
        return new Holder();
    }

    public Holder() {
    }

    public Holder(T t) {
        this.target = t;
    }

    public T update(T target) {
        return this.target = target;
    }

    public boolean isEmpty() {
        return this.target == null;
    }
}
